/*
 * @Author: luojianfeng
 * @Date: 2023-03-06 14:30:57
 * @LastEditTime: 2023-03-07 09:57:27
 * @LastEditors: luojianfeng
 * @Description:
 */
import { Monaco } from '../types'
import * as monaco from 'monaco-editor'
const modules = import.meta.glob<{ default: any }>('./*.ts', { eager: false })
const languages: Record<
  string,
  () => Promise<{ default: (monaco: Monaco) => void }>
> = {}
Object.keys(modules).forEach((item) => {
  const res = item.match(/\w+\.ts/)
  if (res) {
    modules[item]().then((res) => {
      res.default(monaco)
      // console.log(res.default)
    })
  }
})
